<?php

/**
 * Defines an exercise object
 *
 * PHP version 5
 *
 * LICENSE: This source file is subject to the MIT License, available
 * at http://www.opensource.org/licenses/mit-license.html
 *
 * @author     Jayson Schmidt <jayson@888mobileapps.com>
 * @copyright  2013 888MobileApps
 * @license    http://www.opensource.org/licenses/mit-license.html
 */

class Exercise extends DB_Connect {

	/*
	 * @var string The name of the exercise (ie curl)
	 */
	private $_name;
	
	/*
	 * @var int The primary id of the exercise in the db
	 */
	private $_id;

	public function __construct($exercise) {
		if(is_array($exercise)) {
			$this->_id = $exercise['pid'];
			$this->_name = $exercise['exercise_name'];
		}else {
		
			throw new Exception("Invalid exercise data was supplied");
		}
	}
	
	public function __get($property) {
		if(property_exists($this, $property)) {
			return $this->$property;
		}
	}
	
	public function __set($property, $value) {
		if(property_exists($this, $property)) {
			$this->$property = $value;
		}
	}
	
}

?>